<template>
  <div class="page">
    <div class="header">
      <img src="@/assets/images/logo.png" alt="" />
    </div>
    <div class="main">
      <div class="container">
        <div class="container-left">
          <div class="container-top">
            <div class="top">
              <div class="location">
                您的当前位置：<router-link to="/login">首页</router-link>>
                <span>详情页</span>
              </div>
            </div>
          </div>
          <div class="content">
            <div class="contentTitle">
              <p>{{ datailData.title }}</p>
              <p class="time">日期：<span>{{ datailData.add_time | formatTime}}</span></p>
            </div>
            <div class="contentText" v-html="datailData.content"></div>
          </div>
        </div>
      </div>
    </div>
    <div class="copyright">
      <div class="box">
        <div class="box-text">
          <p>
            <span>主办单位：重庆市教育委员会</span>
            <span>技术支持：重庆佰特思科技有限公司、昭信教育集团</span>
          </p>
          <p>
            <span>联系我们</span>
            <span>电话：023-67919893 023-67778602</span>
            <span>邮箱：cqooc@cqooc.com</span>
          </p>
          <p>
            <a href="http://www.cqooc.com/">渝ICP备14007033号-4</a>
            <a href="http://www.cqooc.com/"
              ><img
                src="@/assets/images/gongan.png"
              />渝公网安备：50011202501338号</a
            >
          </p>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import { ArtDetail } from "@/api/login";
import moment from 'moment';
export default {
  name: "ListDetails",
  data() {
    return {
      datailData: "",
      aid: "",
      token: "",
    };
  },
  filters:{
    formatTime(time) {
      return moment(time * 1000).format("YYYY-MM-DD");
    }
  },
  methods: {
    queryArtDetail() {
      ArtDetail({
        token: this.token,
        a_id: this.aid,
      }).then((result) => {
        const { data } = result;
        this.datailData = data;
        if (result.msg === "数据不存在") {
          this.$router.push({
            path: "/dataError",
          });
        }
        if (result.code === -1) {
          this.$router.push({
            path: "/rootError",
          });
        }
      });
    },
    backgroundShow() {
      this.$emit("backgroundShow", this.Showbg);
    },
    back() {
      this.$router.go(-1);
    },
  },
  created() {
    this.backgroundShow();
  },
  mounted() {
    const token = sessionStorage.getItem("token");
    const aid = this.$route.query.a_id;
    this.token = token;
    this.aid = aid;
    this.queryArtDetail();
  },
};
</script>
<style lang='scss' scoped>
.header {
  display: flex;
  align-items: center;
  width: 100%;
  height: 110px;
  background-color: #ffffff;
  font-size: 30px;
  letter-spacing: 2px;
  color: #2b3139;
  img {
    width: 387px;
    height: 67px;
    margin: 0 30px 0 40px;
  }
  div {
    text-align: left;
    line-height: 40px;
  }
}
.main {
  font-family: "Avenir", Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  padding: 30px 0;
  color: #242748;
  margin: 0 auto;
  position: relative;
  font-size: 18px;
  // margin: 0 50px 20px 30px;
  text-align: left;
  font-family: "PingFang";
  background: url(../../assets/images/nologinbg.png);
  .container {
    width: 1500px;
    margin: 0 auto;
    height: 100%;
    & > div {
      width: 100%;
      background-color: #fff;
    }
    .content {
      position: relative;
      padding: 0 40px;
      height: 860px;
      overflow-y: auto;
      font-size: 16px;
      .contentTitle {
        padding: 0 0 20px;
        margin-bottom: 20px;
        border-bottom: solid 1px #e7e9eb;
        text-align: center;
        line-height: 35px;
        color: #8f8e8e;
        &>p:first-of-type{
          font-size: 22px;
          line-height: 50px;
          color: #242748;
          font-weight: 700;
        }
      }
      /deep/.contentText {
        line-height: 50px;
        p {
          span {
            font-size: 18px !important;
            font-family: "PingFang" !important;
          }
        }
      }
    }
    .container-top {
      padding: 20px 45px 20px;
      // border-bottom: solid 1px #e7e9eb;
      .top {
        display: flex;
        justify-content: space-between;
        & > div:first-child {
          display: flex;
          align-items: center;
          .title {
            font-size: 22px;
            font-family: "黑体";
            color: #5673ff;
            margin-right: 60px;
          }
        }
        .location{
            &>a{
              color: #5673ff;
            }
            &>span{
              color: #000;
            }
          }
        .column {
          display: flex;
          font-size: 16px;
          .item {
            display: flex;
            align-items: center;
            padding-right: 20px;
            img {
              width: 15px;
              height: 15px;
              margin-right: 12px;
            }
          }
          /deep/.el-badge__content.is-fixed.is-dot {
            left: 2px;
            top: 2px;
          }
        }
        .oper {
          .shrink {
            background-color: #69a1ff;
            border: solid 1px #4d8df7;
            box-shadow: 0px 4px 15.52px 0.48px rgba(73, 100, 245, 0.39);
          }
          /deep/.icon-zhankai {
            font-size: 18px;
          }
        }
      }
      .article {
        display: flex;
        align-items: center;
        p {
          display: flex;
          align-items: center;
          width: 30%;
          margin-right: 75px;
          color: #a1a4b5;
        }
        span {
          display: inline-block;
          width: 75%;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
      }
    }
    .close {
      width: 80px;
      height: 30px;
      line-height: 30px;
      padding: 0;
      border: solid 1px #e7e9eb;
      background-color: rgb(255, 255, 255);
      box-shadow: 0px 4px 15.52px 0.48px rgba(73, 100, 245, 0.14);
      color: #242748;
      /deep/i {
        margin-right: 6px;
        vertical-align: bottom;
      }
    }
    .green {
      position: absolute;
      bottom: 10%;
      left: 50%;
      transform: translateX(-50%);
      background-color: #03c5a9;
      padding: 11px 20px;
      border: none;
      font-family: "PingFang";
      font-weight: 700;
      color: #fff;
      /deep/i {
        margin-right: 5px;
      }
    }
  }
}
.copyright {
  background-color: #444547;
  width: 100%;
  height: 155px;
  padding: 40px 0;
  .box {
    width: 1200px;
    margin: 0 auto;
    color: #8f8e8e;
    text-align: left;
    display: flex;
    justify-content: space-between;
    font-family: "黑体";
    .box-text {
      h1 {
        margin-bottom: 40px;
        font-size: 30px;
      }
      p {
        line-height: 30px;
        font-size: 14px;
        a {
          display: inline-block;
        }
        span,
        a {
          margin-right: 20px;
          img {
            width: 22px;
            height: 22px;
            margin-right: 5px;
            vertical-align: middle;
          }
        }
      }
    }
    .box-img {
      width: 30%;
      display: flex;
      div {
        margin-left: 30px;
        width: 130px;
        img {
          height: 130px;
        }
        // a{
        //   display: block;
        // }
        p {
          margin-top: 8px;
          line-height: 15px;
          font-size: 14px;
          text-align: center;
        }
      }
    }
  }
}
</style>
